﻿<%@ Page Language="vb" MasterPageFile="~/MainPage.Master" AutoEventWireup="false" CodeBehind="List.aspx.vb" Inherits="PetsCare.List" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">


    &nbsp;<asp:ImageButton ID="ImageButton1" runat="server" Height="57px" 
        ImageUrl="~/Images/rss.png" Width="64px" /><br /><br />
      <div><center>
          
          <asp:Panel ID="Panel1" runat="server" Height="32px" Width="565px" 
              CssClass="ListSearchPanel">
          Search According to Tags!
              <asp:DropDownList ID="DropDownList1" runat="server" 
            DataSourceID="DropDownTagList" DataTextField="TagName" DataValueField="ID" 
            Height="24px" Width="117px">
              </asp:DropDownList>
              &nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="Search_btn" runat="server" Text="Search" />
              &nbsp;&nbsp;
              <asp:Button ID="Show_all" runat="server" Text="Show All" />
          </asp:Panel><asp:DropShadowExtender ID="DropShadowExtender1" runat="server" TargetControlID="Panel1" Opacity=".8" Rounded="true">
          </asp:DropShadowExtender>
       <%--   <asp:ScriptManager ID="ScriptManager1" runat="server">
          </asp:ScriptManager>--%>
          <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
          </asp:ToolkitScriptManager>
          <asp:SqlDataSource ID="DropDownTagList" runat="server" 
              ConnectionString="<%$ ConnectionStrings:PetsConnectionString %>" 
              ProviderName="<%$ ConnectionStrings:PetsConnectionString.ProviderName %>" 
              SelectCommand="SELECT * FROM [Tags_tbl]"></asp:SqlDataSource>
          <br />
          <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
              ConnectionString="<%$ ConnectionStrings:PetsConnectionString %>" 
              ProviderName="<%$ ConnectionStrings:PetsConnectionString.ProviderName %>" 
              
              SelectCommand="SELECT * FROM [newSearchingAccordingtotags] WHERE ([TagID] = ?)">
              <SelectParameters>
                  <asp:ControlParameter ControlID="DropDownList1" Name="TagID" 
                      PropertyName="SelectedValue" Type="Int32" />
              </SelectParameters>
          </asp:SqlDataSource></center>
    </div>
        
    
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CssClass="mGrid" DataSourceID="ListDataSource1" Width="887px" 
            DataKeyNames="ID" Height="84px" CellPadding="4" ForeColor="#333333" 
            GridLines="None">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:ImageField DataImageUrlField="photo">
                </asp:ImageField>
                <asp:BoundField DataField="PetName" HeaderText="PetName" 
                    SortExpression="PetName" />
                <asp:BoundField DataField="Colour" HeaderText="Colour" 
                    SortExpression="Colour" />
                <asp:BoundField DataField="Weight" HeaderText="Weight" 
                    SortExpression="Weight" />
                <asp:BoundField DataField="Age" HeaderText="Age" SortExpression="Age" />
                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataNavigateUrlFormatString="Details.aspx?ID={0}" Text="More Detail" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <br />
        <div>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            CssClass="mGrid" DataSourceID="SqlDataSource1" Width="508px" Height="84px" 
                CellPadding="4" ForeColor="#333333" 
            GridLines="None" Visible="False">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:ImageField DataImageUrlField="photo" HeaderText="Image">
                </asp:ImageField>
                <asp:HyperLinkField DataNavigateUrlFields="petID" 
                    DataNavigateUrlFormatString="Details.aspx?ID={0}" DataTextField="PetName" 
                    Text="Name" />
                <asp:BoundField DataField="TagName" HeaderText="Tag" SortExpression="TagName" />
                <asp:BoundField DataField="Colour" HeaderText="Colour" 
                    SortExpression="Colour" />
                <asp:BoundField DataField="Weight" HeaderText="Weight" 
                    SortExpression="Weight" />
                <asp:BoundField DataField="Age" HeaderText="Age" SortExpression="Age" />
                <asp:BoundField DataField="TagName" HeaderText="TagName" 
                    SortExpression="TagName" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        </div>
        <asp:SqlDataSource ID="ListDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PetsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:PetsConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT [PetName], [Weight], [Age], [Colour], [Advantage], [Disadvantage], [photo], [Description], [OwnerName], [ID] FROM [PetDetails]">
        </asp:SqlDataSource>
        <br />
        <br />
    </div>
   </asp:Content>
   
   
 
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">

    <link href="StyleSheet1.css" rel="stylesheet" type="text/css" />

</asp:Content>

   
   
   

